package com.neuedu.my12306.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	public static Date pareDate(String dateString) {
		Date birthDate = null;
		if (dateString==null|| dateString.trim().length()==0) {
			return null;
		}
		String pattern = "yyyy-MM-dd";
		
		SimpleDateFormat dateFormat = new  SimpleDateFormat(pattern);
		try {
			birthDate =  dateFormat.parse(dateString);
		} catch (ParseException e) {
		
		}
		
		
		return birthDate;
		
	}
	public static Date pareTime(String timeString) {
		Date birthDate = null;
		if (timeString==null|| timeString.trim().length()==0) {
			return null;
		}
		String pattern = "HH:mm:ss";
		
		SimpleDateFormat dateFormat = new  SimpleDateFormat(pattern);
		try {
			birthDate =  dateFormat.parse(timeString);
		} catch (ParseException e) {
		
		}
		
		
		return birthDate;
		
	}



}
